package com.duxd.springsecurityfinal.springsecurityfinal.mvc.config;

import com.duxd.springsecurityfinal.springsecurityfinal.security.config.AuthenticationRequestMappingHandlerMapping;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @author dong
 * @date 2022/1/17 0017
 * 依赖spring boot自动装配mvc实现来注入自定义的mvc组件
 * 用来替换 {@link  WebMvcConfiguration}
 */
@Component
public class EnableMvcAutoConfigRegistrations implements WebMvcRegistrations {

    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new AuthenticationRequestMappingHandlerMapping();
    }
}
